﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/AdminPage.master" AutoEventWireup="true" CodeFile="Branch_Add.aspx.cs" Inherits="AddNewBranch" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <script type="text/javascript">
    function ShowMessage() 
    {
        alert('Add new Branch successful!');
        window.location.href = 'Branch_Management.aspx';
    }

</script>
    <table class="style3" align="center" >
        <tr>
            <td colspan="3" style="background-image: url(../images/bg_head.png); height: 30px" 
                class="style3">

                <asp:Label ID="Label1" runat="server" ForeColor="White" Text="Add New Branch" 
                    Font-Bold="True" ></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="style6" style="width: 12%">
                &nbsp;</td>
            <td class="style6">
                City Name</td>
            <td>
                <asp:DropDownList ID="ddlCity" runat="server" 
                    DataSourceID="SqlDataSource1" DataTextField="CityName" 
                    DataValueField="CityID" Width="175px" Height="22px">
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:OPOConnectionString %>" 
                    SelectCommand="SELECT * FROM [City]"></asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td class="style6" style="width: 12%">
                &nbsp;</td>
            <td class="style6">
                Branch Name</td>
            <td>
                <asp:TextBox ID="txtBName" runat="server" Width="170px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvBName" runat="server" 
                    ControlToValidate="txtBName" ErrorMessage="Branch name can not be blank" 
                    Font-Size="Large" ForeColor="Red">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style6" style="width: 12%">
                &nbsp;</td>
            <td class="style6">
                Branch Address</td>
            <td>
                <asp:TextBox ID="txtBAddress" runat="server" Height="80px" TextMode="MultiLine" 
                    Width="170px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvBAddress" runat="server" 
                    ControlToValidate="txtBAddress" ErrorMessage="Branch address can not be blank" 
                    Font-Size="Large" ForeColor="Red">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style6" style="width: 12%">
                &nbsp;</td>
            <td class="style6">
                Branch Phone</td>
            <td>
                <asp:TextBox ID="txtBPhone" runat="server" Width="170px"></asp:TextBox>
                <asp:RegularExpressionValidator ID="revBPhone" runat="server" 
                    ControlToValidate="txtBPhone" 
                    ErrorMessage="Branch phone contains numbers only and has 6 digits above" 
                    Font-Size="Large" ForeColor="Red" ValidationExpression="\d{6,}">*</asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td class="style6" style="width: 12%">
                &nbsp;</td>
            <td class="style6">
                Branch Email</td>
            <td>
                <asp:TextBox ID="txtBEmail" runat="server" Width="170px"></asp:TextBox>
                <asp:RegularExpressionValidator ID="revBEmail" runat="server" 
                    ControlToValidate="txtBEmail" ErrorMessage="Email must be in correct format" 
                    Font-Size="Large" ForeColor="Red" 
                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td class="style3" style="width: 12%">
                &nbsp;</td>
            <td class="style5" colspan="2">
                <asp:ValidationSummary ID="ValidationSummary1" runat="server" ForeColor="Red" />
            </td>
        </tr>
        <tr>
            <td class="style3" style="width: 12%">
                &nbsp;</td>
            <td class="style5" colspan="2">
                <asp:ImageButton ID="imgbAdd" runat="server" 
                    ImageUrl="~/images/img_Add.png" onclick="imgbAdd_Click" />
                <asp:ImageButton ID="imgbReset" runat="server" 
                    ImageUrl="~/images/img_Reset.png" CausesValidation="False" 
                    onclick="imgbReset_Click" />
                <asp:ImageButton ID="imgbCancel" runat="server" 
                    ImageUrl="~/images/img_Cancel.png" CausesValidation="False" 
                    onclick="imgbCancel_Click" />
            </td>
        </tr>
        <tr>
            <td class="style3" style="width: 12%">
                &nbsp;</td>
            <td class="style5" colspan="2">
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>

